import React from 'react'
import bus from './bus'

export default function Child2 (props) {
  return (
    <div>
      <h3>函数式Child2</h3>
      <p>
        {props.name} {props.age} 爱好：{props.hobby}{' '}
      </p>
      <p>
        住在{props.address.province},{props.address.city}
      </p>
      <p>
        <button
          onClick={() => {
            bus.emit('myevent', ['打游戏', '游泳', '打羽毛球'])
          }}
        >
          兄弟传值
        </button>
      </p>
    </div>
  )
}
